﻿using System;
using NHibernate;
using NHibernate.Tool.hbm2ddl;
using NHibernate.Cfg;

using FactoryOfSessions;

namespace BDExportUtility
{
    static class BDExport
    {
        static Configuration Config;
        
        static public void BuildSchema()
        {
            new SchemaExport(Config).Create(true, true);
        }

        static void Main(string[] args)
        {
            Console.WriteLine("University Data Base is creating... \nPlease, wait some time...");
            SessionsFactory.Init(Resources.ServerName, Resources.DBName);
            Config = SessionsFactory.Config;       
            BuildSchema();
            Console.WriteLine("University Data Base was built! Press any key...");
            Console.ReadKey();
        }
    }
}
